package com.web.service.impl;

import com.web.dao.HotelDao;
import com.web.dao.RoomDao;
import com.web.domain.Hotel;
import com.web.service.HotelService;
import com.web.vo.RoomVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by 陈国钰 on 2016/9/5.
 */
@Service
@Transactional(rollbackFor = {java.lang.Exception.class})
public class HotelServiceImpl implements HotelService {
    @Autowired
    private HotelDao hotelDao;
    @Autowired
    private RoomDao roomDao;

    public List<Hotel> searchHotel(String cityName) {
        return hotelDao.searchHotel(cityName);
    }


    public List<RoomVo> searchRoom(int hotelId) {
        return roomDao.searchRooms(hotelId);
    }


    public Hotel findHotelById(Integer hotelId) {
        return hotelDao.findHotelById(hotelId);
    }


}
